package pl.edu.pk.rz.entity;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "page")
public class Page {

	@Id
	@Column(name = "id")
	private int id;

	@Column(name = "title")
	private String title;
	
	@Column(name = "content")
	private String content;

	@OneToMany(fetch = FetchType.EAGER, mappedBy = "page")
	private Set<Post> posts = new HashSet<Post>();

	@Column(name = "active")
	private boolean active;

	@Column(name = "visible_not_logged")
	private boolean visibleNotLogged;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public boolean isActive() {
		return active;
	}

	public void setActive(boolean active) {
		this.active = active;
	}

	public boolean isVisibleNotLogged() {
		return visibleNotLogged;
	}

	public void setVisibleNotLogged(boolean visibleNotLogged) {
		this.visibleNotLogged = visibleNotLogged;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Set<Post> getPosts() {
		return posts;
	}

	public void setPosts(Set<Post> posts) {
		this.posts = posts;
	}

}
